using System;
using System.Data.EntityClient;
using EFPocoAdapter;

namespace SFS.SampleApp.BusinessObjects
{
    public interface ISFSSampleAppContext
    {
        IEntitySet<SFS.SampleApp.BusinessObjects.Address> Addresses { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.Customer> Customers { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.CustomerAddress> CustomerAddresses { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.Product> Products { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.ProductCategory> ProductCategories { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.ProductDescription> ProductDescriptions { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.ProductModel> ProductModels { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.ProductModelProductDescription> ProductModelProductDescriptions { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.SalesOrderDetail> SalesOrderDetails { get; }
        IEntitySet<SFS.SampleApp.BusinessObjects.SalesOrderHeader> SalesOrderHeaders { get; }
    }

    public partial class SFSSampleAppContext : EFPocoContext<SFS.SampleApp.BusinessObjects.PocoAdapters.SFSSampleAppContextAdapter>, ISFSSampleAppContext
    {
        public SFSSampleAppContext() : base(new SFS.SampleApp.BusinessObjects.PocoAdapters.SFSSampleAppContextAdapter()) { }
        public SFSSampleAppContext(string connectionString) : base(new SFS.SampleApp.BusinessObjects.PocoAdapters.SFSSampleAppContextAdapter(connectionString)) { }
        public SFSSampleAppContext(EntityConnection connection) : base(new SFS.SampleApp.BusinessObjects.PocoAdapters.SFSSampleAppContextAdapter(connection)) { }

        public IEntitySet<SFS.SampleApp.BusinessObjects.Address> Addresses
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.Address>("Addresses"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.Customer> Customers
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.Customer>("Customers"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.CustomerAddress> CustomerAddresses
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.CustomerAddress>("CustomerAddresses"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.Product> Products
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.Product>("Products"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.ProductCategory> ProductCategories
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.ProductCategory>("ProductCategories"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.ProductDescription> ProductDescriptions
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.ProductDescription>("ProductDescriptions"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.ProductModel> ProductModels
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.ProductModel>("ProductModels"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.ProductModelProductDescription> ProductModelProductDescriptions
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.ProductModelProductDescription>("ProductModelProductDescriptions"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.SalesOrderDetail> SalesOrderDetails
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.SalesOrderDetail>("SalesOrderDetails"); }
        }

        public IEntitySet<SFS.SampleApp.BusinessObjects.SalesOrderHeader> SalesOrderHeaders
        {
            get { return GetEntitySet<SFS.SampleApp.BusinessObjects.SalesOrderHeader>("SalesOrderHeaders"); }
        }
    }
}
